package org.metasketch.editor.toolbox;

import java.util.ArrayList;
import java.util.List;

public class RelationManager {

	List<BaseRelation> relations = new ArrayList<BaseRelation>();

	public void register(BaseRelation relation) {
		relations.add(relation);
	}

	public BaseRelation getParentRelation(Class childType, Class parentType) {
		for (BaseRelation relation : relations) {
			if (relation.isCompatible(childType, parentType))
				return relation;

		}
		return null;
	}

}
